<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->resource('partner', 'PartnerController');
    $router->resource('class', 'ClassController');
    $router->resource('student', 'StudentController');
    $router->resource('book', 'TeachingMaterialController');
    $router->resource('one', 'KeywordOneController');
    $router->resource('two', 'KeywordTwoController');
    $router->resource('paint', 'PaintController');
    $router->resource('video', 'VideoController');
    $router->resource('spelling', 'NaturalSpellingController');
    $router->resource('test', 'TestBookController');
    $router->resource('curriculum', 'CurriculumController');
    $router->resource('affiche', 'AfficheController');
    $router->get('books/{book}/unit', 'TeachingMaterialController@unitList');
    $router->get('classd/{book}/student', 'ClassController@studentList');
    $router->post('books/{book}/unit', 'MaterialUnitController@store');
    $router->get('books/{book}/unit/create', 'MaterialUnitController@newCreate');
    $router->get('books/{book}/unit/{id}/edit', 'MaterialUnitController@newEdit');
    $router->get('books/{book}/unit/{id}', 'MaterialUnitController@newShow');
    $router->get('classed/select', 'ClassController@select');
    $router->get('books/select', 'TeachingMaterialController@select');
    $router->put('books/{book}/unit/{id}', 'MaterialUnitController@newUpdate');
    $router->delete('books/{book}/unit/{id}', 'MaterialUnitController@delete');
    $router->any('ones/files', 'KeywordOneController@handle');
    $router->any('twos/files', 'KeywordTwoController@handle');
    $router->any('paints/files', 'PaintController@handle');
});
